package com.code.user.service.impl;

import com.code.commons.service.impl.BaseMySqlCrudServiceImpl;
import com.code.user.api.LoginCredentialService;
import com.code.user.model.po.LoginCredential;
import com.code.user.service.mapper.LoginCredentialMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;

/**
 * 登陆凭证业务逻辑层（登陆凭证基础服务层）
 *
 * @author tangyifei
 */
@Service
public class LoginCredentialServiceImpl extends BaseMySqlCrudServiceImpl<LoginCredential, Long> implements LoginCredentialService {

    @Resource
    private LoginCredentialMapper loginCredentialMapper;

    @Override
    public void modifyTranPwd(Long id, String newTranPwd) {
        loginCredentialMapper.modifyTranPwd(id, newTranPwd, new Date());
    }

    @Override
    public LoginCredential getUserLoginCredential(String userId) {
        return loginCredentialMapper.getUserLoginCredential(userId);
    }
}
